home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / pdm_106.zip / PDMDEMO1.PRG < prev    next >
Text File  |  1991-06-08  |  10KB  |  269 lines

  1.  
  2. *≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡*
  3. * Program Name: PDMDEMO1.PRG
  4. * Description.: Driver for PDM Menu System program
  5. * Language....: Clipper S'87
  6. * LIB required: CC.LIB v1.04, EXTEND.LIB
  7. * Gen Time....: 06/08/91 17:57:40
  8. * Generated by: PDM Sys - the ClipCode Pull Down Menu System  v1.06
  9. *≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡*
  10. *** Set CLIPPER Environment ***
  11. SET CURSOR OFF
  12. SET DELETED ON                          && Filter out Deleted Records
  13. SET EXACT ON
  14. SET SCOREBOARD OFF
  15. SET SOFTSEEK OFF
  16.  
  17. PDMSETUP()
  18.  
  19. *** Set Color for Initial Screen ***
  20. SET COLOR TO ( PDM_CONFG[7] )
  21. @1,0 SAY REPLICATE( CHR( PDM_CONFG[8] ), 1840 ) && char for init screen
  22.  
  23. SET COLOR TO ( PDM_COLOR[1] )           && hcolor when not selected
  24. @ PDM_CONFG[2],00
  25.  
  26. SET COLOR TO ( PDM_CONFG[6] )           && color for init bottom panel
  27. @ PDM_CONFG[4],00
  28. @ PDM_CONFG[4],00 SAY PDM_CONFG[9]      && text for init bottom panel
  29.  
  30. MENUPD( 0, 0 )                          && just display h menu
  31.  
  32. PRIVATE key, hOpt, vOpt, pdSEL, sv_panel
  33. pdSel= 1
  34. DO WHILE .T.
  35.  
  36.   *SETCANCEL(.F.)                        && Disable alt-C interrupt
  37.   INKEY(0)
  38.   key= LASTKEY()                        && key= INKEY(0) misses alt-D
  39.   *SETCANCEL(.T.)                        && Enable alt-C interrupt
  40.  
  41.   DO CASE
  42.   *?*CASE key = 28                         && F1=Help
  43.  
  44.   *?*CASE key = -2                         && F3=Exit
  45.   ***  EXIT2DOS()
  46.  
  47.   CASE key = 27                         && Exit
  48.     PRIVATE Opts[2]
  49.     Opts[1]= "Yes"
  50.     Opts[2]= "No"
  51.      * Syntx: message text,       [ title,prmpts,colors,mRow,mColm,TmO ]
  52.     IF BOXMSG( "Exit Program to DOS?",.F., Opts ) = 1
  53.       EXIT
  54.     ELSE
  55.       LOOP
  56.     ENDIF
  57.   CASE key = -9                         && F10=Menu
  58.     hOpt=  1
  59.     vOpt=  0
  60.   *?*CASE key = 3                          && PgDn=Next
  61.   ***  SKIP 1
  62.   ***  IF EOF()
  63.   ***    BOXMSG( "At End-of-File" )
  64.   ***    SKIP -1
  65.   ***  ENDIF
  66.   *?*CASE key = 18                         && PgUp=Prev
  67.   ***  SKIP -1
  68.   ***  IF BOF()
  69.   ***    BOXMSG( "At Beginning-of-File" )
  70.   ***  ENDIF
  71.  
  72.   CASE ASCAN( PDM_HOTKY, key ) > 0      && If found, returns the ss
  73.     hOpt=  ASCAN( PDM_HOTKY, key )
  74.     vOpt=  1
  75.   OTHERWISE
  76.     LOOP
  77.   ENDCASE
  78.  
  79.   IF hOpt < 1
  80.     LOOP
  81.   ENDIF
  82.  
  83.   sv_panel= BOXSAVE( PDM_CONFG[4],00, PDM_CONFG[4],79 )
  84.   pdSel   = 1
  85.   DO WHILE pdSel <> 0
  86.  
  87.     pdSel= MENUPD( @hOpt, @vOpt )
  88.     IF pdSel > 0
  89.       DO CASE
  90.       OTHERWISE
  91.         * Syntx: message text/array, [ title,prmpts,colors,mRow,mColm,TmO ]
  92.         BOXMSG( "PDM Option Selected: "+LTRIM( STR(pdSel) ) )
  93.       ENDCASE
  94.     ENDIF
  95.   ENDDO WHILE pdSel <> 0
  96.   BOXREST( sv_panel )
  97.  
  98. ENDDO
  99. SET COLOR TO
  100. SET CURSOR ON
  101. CLEAR
  102. QUIT                                                    && End of: MAIN LINE
  103. *≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡*
  104.  
  105. *------------------------------------------------------------------------------*
  106. * Function....: PDMSETUP()
  107. * Purpose.....: UDF to Create PDMSETUP()
  108. * Parameters..: none
  109. * Generated by: PDM - the ClipCode Pull Down Menu System
  110. * Assumption..: the presence of these PUBLIC arrays:
  111. *             : <arrC>: PDM_HPROM = horizontal menu prompt text
  112. *             : <arrN>: PDM_HCOLM = horizontal starting columns for prompts
  113. *             : <arrC>: PDM_HTRIG = horizontal trigger letters
  114. *             : <arrN>: PDM_HTPOS = horizontal trigger letter positions
  115. *             : <arrN>: PDM_VSS1  = starting array subscript
  116. *             : <arrN>: PDM_VSS2  = ending array subscript
  117. *             : <arrC>: PDM_VPROM = vertical menu prompt text
  118. *             : <arrC>: PDM_VTRIG = vertical trigger letters
  119. *             : <arrN>: PDM_VCOLM = vertical starting columns for v prompts
  120. *             : <arrN>: PDM_VTPOS = vertical trigger letter positions
  121. *             : <arrL>: PDM_VACTV = vertical active status array
  122. *             : <arrC>: PDM_COLOR = PDM color strings for SET COLOR TO
  123. *                                     [ 1] hcolor when not selected
  124. *                                     [ 2] hcolor for unselected trigger
  125. *                                     [ 3] hcolor for selected option
  126. *                                     [ 4] hcolor for selected trigger
  127. *                                     [ 5] vcolor for box
  128. *                                     [ 6] vcolor when not selected
  129. *                                     [ 7] vcolor for unselected trigger
  130. *                                     [ 8] vcolor for selected option
  131. *                                     [ 9] vcolor for selected trigger
  132. *                                     [10] vcolor for inactive option
  133. *                                     [11] vcolor for message row
  134. *             : <arrC>: PDM_VMSSG = vertical message help text
  135. *             : <arrX>: PDM_CONFG = PDM configuration
  136. *                                     [1] = expN: box type: 0,1,2
  137. *                                     [2] = expN: row for horiz menu
  138. *                                     [3] = expN: row for box top
  139. *                                     [4] = expN: message row
  140. *                                     [5] = expN: time out
  141. *                                     [6] = expC: color for init bottom panel
  142. *                                     [7] = expC: color for init screen
  143. *                                     [8] = expN: char for init screen
  144. *                                     [9] = expC: text for init bottom panel
  145. * Calls.......: PDM_INIT()
  146. * CC.LIB Calls: ALONGEST(), ATNEXT()
  147. * Language....: Clipper S'87
  148. * Returns.....: <expL>: .T.
  149. *------------------------------------------------------------------------------*
  150. FUNCTION PDMSETUP
  151.  
  152. PRIVATE dimh, dimv, ss
  153.  
  154. *** MENUPD Horizontal ***
  155. dimh= 3
  156. PUBLIC PDM_HPROM[dimh]                  && horizontal menu prompt text
  157. PDM_HPROM[1]= " First Menu 1 "
  158. PDM_HPROM[2]= " Second Menu 2 "
  159. PDM_HPROM[3]= " Third Menu 3 "
  160.  
  161. PUBLIC PDM_HCOLM[dimh]                  && horizontal starting columns for prompts
  162. PDM_HCOLM[1]= 1
  163. PDM_HCOLM[2]= 15
  164. PDM_HCOLM[3]= 30
  165.  
  166. PUBLIC PDM_HOTKY[dimh]                  && horiz Hot/alt keys INKEY()
  167. PDM_HOTKY[1]= 289
  168. PDM_HOTKY[2]= 287
  169. PDM_HOTKY[3]= 276
  170.  
  171. PUBLIC PDM_HTRIG[dimh]                  && horizontal trigger letters
  172. PDM_HTRIG[1]= "F"
  173. PDM_HTRIG[2]= "S"
  174. PDM_HTRIG[3]= "T"
  175.  
  176. PUBLIC PDM_HTPOS[dimh]                  && horizontal trigger letter  positions
  177. PDM_HTPOS[1]= 2
  178. PDM_HTPOS[2]= 2
  179. PDM_HTPOS[3]= 2
  180.  
  181. *** PDMENUV Vertical ***
  182. PUBLIC PDM_VSS1[dimh]                   && starting array subscript
  183. PDM_VSS1[1]= 1
  184. PDM_VSS1[2]= 4
  185. PDM_VSS1[3]= 7
  186.  
  187. dimv= 10
  188. PUBLIC PDM_VPROM[dimv]                  && vertical menu prompt text
  189. PDM_VPROM[ 1]= " Vert menu 1     "
  190. PDM_VPROM[ 2]= " Vert Menu 2     "
  191. PDM_VPROM[ 3]= " Vertical menu 3 "
  192. PDM_VPROM[ 4]= " Option vert 4 "
  193. PDM_VPROM[ 5]= " vert menu 5   "
  194. PDM_VPROM[ 6]= " vert menu 6   "
  195. PDM_VPROM[ 7]= " vert menu 7 "
  196. PDM_VPROM[ 8]= "-"
  197. PDM_VPROM[ 9]= " vert menu 8 "
  198. PDM_VPROM[10]= " vert menu 9 "
  199.  
  200. PUBLIC PDM_VTRIG[dimv]                  && vertical trigger letters
  201. PDM_VTRIG[ 1]= "V"
  202. PDM_VTRIG[ 2]= "M"
  203. PDM_VTRIG[ 3]= "e"
  204. PDM_VTRIG[ 4]= "p"
  205. PDM_VTRIG[ 5]= "v"
  206. PDM_VTRIG[ 6]= "m"
  207. PDM_VTRIG[ 7]= "v"
  208. PDM_VTRIG[ 8]= "-"
  209. PDM_VTRIG[ 9]= "e"
  210. PDM_VTRIG[10]= "r"
  211.  
  212. PUBLIC PDM_VTPOS[dimv]                  && vertical trigger letter positions
  213. PDM_VTPOS[ 1]= 2
  214. PDM_VTPOS[ 2]= 7
  215. PDM_VTPOS[ 3]= 3
  216. PDM_VTPOS[ 4]= 3
  217. PDM_VTPOS[ 5]= 2
  218. PDM_VTPOS[ 6]= 7
  219. PDM_VTPOS[ 7]= 2
  220. PDM_VTPOS[ 8]= 1
  221. PDM_VTPOS[ 9]= 3
  222. PDM_VTPOS[10]= 4
  223.  
  224. PUBLIC PDM_VACTV[dimv]                  && vertical active status array
  225. AFILL( PDM_VACTV, .T. )
  226. PDM_VACTV[ 8]= .F.
  227.  
  228. PUBLIC PDM_VMSSG[dimv]                  && vertical message help text
  229. PDM_VMSSG[ 1]= "help text 1"
  230. PDM_VMSSG[ 2]= "help text 2"
  231. PDM_VMSSG[ 3]= "help text 3"
  232. PDM_VMSSG[ 4]= "help text 4"
  233. PDM_VMSSG[ 5]= "help text 5"
  234. PDM_VMSSG[ 6]= "help text 6"
  235. PDM_VMSSG[ 7]= "help text 7"
  236. PDM_VMSSG[ 8]= "-"
  237. PDM_VMSSG[ 9]= "help text 8"
  238. PDM_VMSSG[10]= "help text 9"
  239.  
  240. PUBLIC PDM_COLOR[11]                    && PDM color strings for SET COLOR TO
  241. PDM_COLOR[ 1]= "B/W"                     && [ 1] hcolor when not selected
  242. PDM_COLOR[ 2]= "B+/W"                    && [ 2] hcolor for unselected trigger
  243. PDM_COLOR[ 3]= "W+/R"                    && [ 3] hcolor for selected option
  244. PDM_COLOR[ 4]= "W+/R"                    && [ 4] hcolor for selected trigger
  245. PDM_COLOR[ 5]= "W+/B"                    && [ 5] vcolor for box
  246. PDM_COLOR[ 6]= "W/B"                     && [ 6] vcolor when not selected
  247. PDM_COLOR[ 7]= "W+/B"                    && [ 7] vcolor for unselected trigger
  248. PDM_COLOR[ 8]= "R/W"                     && [ 8] vcolor for selected option
  249. PDM_COLOR[ 9]= "R/W"                     && [ 9] vcolor for selected trigger
  250. PDM_COLOR[10]= "R/B"                     && [10] vcolor for inactive option
  251. PDM_COLOR[11]= "N/W"                     && [11] vcolor for message row
  252.  
  253. PUBLIC PDM_CONFG[9]                     && PDM configuration
  254. PDM_CONFG[1]= 1                          && [1] = expN: box type: 0,1,2
  255. PDM_CONFG[2]= 0                          && [2] = expN: row for horiz menu
  256. PDM_CONFG[3]= 2                          && [3] = expN: row for box top
  257. PDM_CONFG[4]= 24                         && [4] = expN: message row
  258. PDM_CONFG[5]= 10                         && [5] = expN: time out
  259. PDM_CONFG[6]= "N/W"                      && [6] = expC: color for init bottom panel
  260. PDM_CONFG[7]= "W+/B"                     && [7] = expC: color for init screen
  261. PDM_CONFG[8]= 32                         && [8] = expN: char for init screen
  262. *                                        && [9] = expC: text for init bottom panel
  263. PDM_CONFG[9]= " Esc=Exit Alt+Letter=Menu"
  264.  
  265. PDM_INIT()                    && Initialize remaining optional PDM PUBLIC arrays
  266.  
  267. RETURN .T.                                                 && End of: PDMSETUP()
  268. *------------------------------------------------------------------------------*
  269. *<eof>